package com.scwatch.core.fulltext;

import com.scwatch.core.domain.Special;
import com.scwatch.core.listener.AbstractSpecialListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * SpecialFulltextListener
 * 
 * @author gjl
 * 
 */
@Component
public class SpecialFulltextListener extends AbstractSpecialListener {
	@Override
	public void postSpecialSave(Special[] beans) {
		generator.addDocument(beans);
	}

	@Override
	public void postSpecialUpdate(Special[] beans) {
		generator.updateDocument(beans);
	}


	@Override
	public void postSpecialDelete(Special[] beans) {
		generator.deleteDocuments(beans);
	}


	private SpecialFulltextGenerator generator;

	@Autowired
	public void setSpecialFulltextGenerator(SpecialFulltextGenerator generator) {
		this.generator = generator;
	}
}
